{include file="public/header" /}
<div>
    <a class="btn btn-primary" href="<?= url('add'); ?>">添加信息</a>
</div>
<div class="col-lg-11">
    <div class="card">
        <div class="card-header">
            <strong class="card-title">动态——旅游</strong>
        </div>
        <div class="card-body">
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th>编号</th>
                        <th>标题</th>
                        <th>时间</th>
                        <th>图片</th>
                        <th>内容</th>
                        <th>发布人</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <ul>
                        <?php if (isset($emps)): foreach ($emps as $emp): ?>
                        <tr>
                            <td>
                                <?php echo $emp['tour_id'] ?>
                            </td>
                            <td>
                                <?= $emp['tour_title'] ?>
                            </td>
                            <td>
                                <?= $emp['tour_time'] ?>
                            </td>
                            <td>
                                <img style="width: 150px" src="{$emp['tour_picture']}">
                              
                            </td>
                            <td>
                                <?= $emp['tour_content'] ?>
                            </td>
                            <td>
                                <?= $emp['username'] ?>
                            </td>
                            <td>
                         
                                <button onclick="showDel('<?= $emp['tour_id'] ?>')" class="btn btn-warning btn-sm">删除</button>

                                 <a class="btn btn-success btn-sm" href="<?= url('edit?tour_id='.$emp['tour_id']) ?>">修改</a>
                    
                            </td>
                        </tr>
                        <?php endforeach; endif; ?>
                    </ul>
                </tbody>
            </table>
        </div>
    </div>
</div>
</div>
<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/jquery@2.2.4/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.4/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-match-height@0.7.2/dist/jquery.matchHeight.min.js"></script>
<script src="__STATIC__/js/main.js"></script>
<!--  Chart js -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.7.3/dist/Chart.bundle.min.js"></script>
<!--Chartist Chart-->
<script src="https://cdn.jsdelivr.net/npm/chartist@0.11.0/dist/chartist.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartist-plugin-legend@0.6.2/chartist-plugin-legend.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery.flot@0.8.3/jquery.flot.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/flot-pie@1.0.0/src/jquery.flot.pie.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/flot-spline@0.0.1/js/jquery.flot.spline.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/simpleweather@3.1.0/jquery.simpleWeather.min.js"></script>
<script src="__STATIC__/js/init/weather-init.js"></script>
<script src="https://cdn.jsdelivr.net/npm/moment@2.22.2/moment.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/fullcalendar@3.9.0/dist/fullcalendar.min.js"></script>
<script src="__STATIC__/js/init/fullcalendar-init.js"></script>
<!--Local Stuff-->
<script src="__STATIC__/layui/layui.js"></script>
<script>
//JavaScript代码区域


layui.use(['element', 'layer', 'laypage'], function() {
    var element = layui.element;
    var layer = layui.layer;
    var laypage = layui.laypage;

    laypage.render({
        elem: 'listpage',
        count: 70 //数据总数，从服务端得到
            ,
        jump: function(obj, first) {
            //obj包含了当前分页的所有参数，比如：
            console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
            console.log(obj.limit); //得到每页显示的条数

            //首次不执行
            if (!first) {
                //do something
            }
        }
    });
});

function showDel(no) {
    var layer = layui.layer;

    layer.confirm('确认删除' + no + '？', {
        btn: ['确认', '取消'] //可以无限个按钮
    }, function(index, layero) {
        //按钮【按钮一】的回调
        location.href = 'del/no/' + no;
        console.log(index)
    }, function(index) {
        //按钮【按钮二】的回调
        console.log(index)
    });



}
</script>
</body>

</html>